<!-- 分销：商菜单栏 -->
<template>
  <view class="menu-box ss-flex-col">
    <view class="header-box">
      <image class="header-bg" :src="sheep.$url.static('/static/img/shop/commission/title1.png')" />
      <view class="ss-flex header-title">
        <view class="title">功能专区</view>
        <text class="cicon-forward"></text>
      </view>
    </view>
    <view class="menu-list ss-flex ss-flex-wrap">
      <view
        v-for="(item, index) in state.menuList"
        :key="index"
        class="item-box ss-flex-col ss-col-center"
        @tap="sheep.$router.go(item.path)"
      >
        <image
          class="menu-icon ss-m-b-10"
          :src="sheep.$url.static(item.img)"
          mode="aspectFill"
        ></image>
        <view>{{ item.title }}</view>
      </view>
    </view>
  </view>
</template>

<script setup>
  import sheep from '@/sheep';
  import { reactive } from 'vue';

  const state = reactive({
    menuList: [
      {
        img: '/7d38b42431ce8a5e6e1293852653bd65772f06cf1c7685cbdbeb4d9bf640a91b.png',
        title: '我的团队',
        path: '/pages/commission/team',
      },
      {
        img: '/6ae2da34f9d559c31154c47914f0bf35a146800b43689ab516b343a5ebb2afe2.png',
        title: '佣金明细',
        path: '/pages/commission/wallet',
      },
      {
        img: '/a311b2bd17080d279690103f3d64aea924596d287bb0ebde2f4bf58c49f04e92.png',
        title: '分销订单',
        path: '/pages/commission/order',
      },
      {
        img: '/9a1dcfe87727e6c5d0a07c87328322ba3fa70e605851c0f5085c152b2f1c7c67.png',
        title: '推广商品',
        path: '/pages/commission/goods',
      },
      // {
      //   img: '/static/img/shop/commission/commission_icon5.png',
      //   title: '我的资料',
      //   path: '/pages/commission/apply',
      //   isAgentFrom: true,
      // },
      {
        img: '/8e20db31efb2fe5c3002028549e2d524edf7dad649568d49583d168c1ffa694c.png',
        title: '邀请海报',
        path: 'action:showShareModal',
      },
      {
        img: '/4bb3eb697642031d4a4c2da9d173689d5ac0ff9245a3a6b1b4de865a4952c8af.png',
        title: '推广排行',
        path: '/pages/commission/promoter',
      },
      {
        img: '/7d38b42431ce8a5e6e1293852653bd65772f06cf1c7685cbdbeb4d9bf640a91b.png',
        title: '佣金排行',
        path: '/pages/commission/commission-ranking',
      },
    ],
  });
</script>

<style lang="scss" scoped>
  .menu-box {
    margin: 0 auto;
    width: 690rpx;
    margin-bottom: 20rpx;
    margin-top: 20rpx;
    border-radius: 12rpx;
    z-index: 3;
    position: relative;
  }

  .header-box {
    width: 690rpx;
    height: 76rpx;
    position: relative;

    .header-bg {
      width: 690rpx;
      height: 76rpx;
    }

    .header-title {
      position: absolute;
      left: 20rpx;
      top: 24rpx;
    }

    .title {
      font-size: 28rpx;
      font-weight: 500;
      color: #ffffff;
      line-height: 30rpx;
    }

    .cicon-forward {
      font-size: 30rpx;
      font-weight: 400;
      color: #ffffff;
      line-height: 30rpx;
    }
  }

  .menu-list {
    padding: 50rpx 0 10rpx 0;
    background: #fdfae9;
    border-radius: 0 0 12rpx 12rpx;
  }

  .item-box {
    width: 25%;
    margin-bottom: 40rpx;
  }

  .menu-icon {
    width: 68rpx;
    height: 68rpx;
    background: #ffffff;
    border-radius: 50%;
  }

  .menu-title {
    font-size: 26rpx;
    font-weight: 500;
    color: #ffffff;
  }
</style>
